package com.j180.service;

import com.j180.bean.Customer;
import com.j180.dao.ICustomerDao;
import com.j180.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class CustomerServiceImpl implements  ICustomerService{

     private SqlSession sqlSession =SqlSessionUtil.getSqlSession();


    @Override
    public List<Customer> showAllCustomersInfo() {

        ICustomerDao iCustomerDao = sqlSession.getMapper(ICustomerDao.class);

        List<Customer> list = iCustomerDao.getAllCustomers();

        sqlSession.close();

        return list;
    }
}
